home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1843 / 1843.xpi / content / firebug / aboutOverlay.js < prev    next >
Text File  |  2010-01-15  |  2KB  |  49 lines

  1. /* See license.txt for terms of usage */
  2.  
  3. (function() {
  4.  
  5. // ************************************************************************************************
  6. // Constants
  7.  
  8. const Cc = Components.classes;
  9. const Ci = Components.interfaces;
  10.  
  11. var sss = Cc["@mozilla.org/content/style-sheet-service;1"].getService(Ci.nsIStyleSheetService);
  12. var ios = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
  13.  
  14. var FBTrace = Cc["@joehewitt.com/firebug-trace-service;1"].getService(Ci.nsISupports)
  15.     .wrappedJSObject.getTracer("extensions.firebug");
  16.  
  17. // ************************************************************************************************
  18. // Overlay
  19.  
  20. var uri = ios.newURI("chrome://firebug/skin/about.css", null, null);
  21.  
  22. var FirebugAboutOverlay =
  23. {
  24.     onLoad: function()
  25.     {
  26.         var extensionID = window.arguments[0];
  27.         if (extensionID == "urn:mozilla:item:firebug@software.joehewitt.com")
  28.             sss.loadAndRegisterSheet(uri, sss.USER_SHEET);
  29.     },
  30.  
  31.     onUnload: function()
  32.     {
  33.         if (sss.sheetRegistered(uri, sss.USER_SHEET))
  34.             sss.unregisterSheet(uri, sss.USER_SHEET);
  35.  
  36.         window.removeEventListener("load", FirebugAboutOverlay.onLoad, false);
  37.         window.removeEventListener("unload", FirebugAboutOverlay.onUnload, false);
  38.     }
  39. };
  40.  
  41. // ************************************************************************************************
  42. // Registration
  43.  
  44. window.addEventListener("load", FirebugAboutOverlay.onLoad, false);
  45. window.addEventListener("unload", FirebugAboutOverlay.onUnload, false);
  46.  
  47. // ************************************************************************************************
  48. })();
  49.